local ClientOHOH = _G.ClientOHOH;

local M = ClientOHOH.class.new(script, ClientOHOH.files.OHOHScreenBase());
local CommonOHOH =_G.CommonOHOH
local CallBackManager = ClientOHOH.load.CallBackManager();
local BtnHelper = ClientOHOH.load.BtnHelper();
local PetTool=_G.CommonOHOH.load.PetTool();
local LanguageHelper=_G.LanguageHelper 
local GeneralTool=_G.CommonOHOH.load.GeneralTool();
local ConnectClass=_G.CommonOHOH.load.Connect();
local ItemTool=_G.CommonOHOH.load.ItemTool();
local BigNumberHelper = ClientOHOH.load.BigNumberHelper();

function InitInsts(ui)
	ui.insts = {};
    -- btn="Frame.Frame.Frame.Content."..i..".ImageButton",
    -- Head="Frame.Frame.Frame.Content."..i..".icon",
    -- name="Frame.Frame.Frame.Content."..i..".name",
    -- boost="Frame.Frame.Frame.Content."..i..".speed",
    ui.insts.Cell="Frame.Frame.ScrollingFrame.cell"
    ui.insts.Close="Frame.Frame.close"
    ui.insts.Title="Frame.Frame.title"
    ui.insts.root="Frame.Frame"
    ui.insts.upd="Frame.Frame.version"

    ui.insts.nextUpd="Frame.Frame.next"


end
function M.MobileSize(self)
	if _G.client.IsMobile then --是移动设备
		if self.insts.root then
			local pos= self.insts.root:GetAttribute("Position")
			local size=self.insts.root:GetAttribute("Size")

			if pos then
				self.insts.root.Position=pos
			end
			if size then
				self.insts.root.Size=size
			end
		end
	end
end

function M.new(...)
	return M(...);
end;
function M.ctor(self)
	InitInsts(self)
	M.super.ctor(self, ClientOHOH:GetPath_Loop("ReplicatedStorage.Resource.UI.UpdateGui"));
	self:MobileSize()
    self.insts.Cell.Visible=false
    -- self.insts.Yes.Text=LanguageHelper:GetText(30071)
    self.insts.Title.Text=LanguageHelper:GetText(901)

    CallBackManager:AddRbxConnect(self,self.insts.Close.Activated, function()
        self:Hide()
	end);
    self.CellList={}
end;


function M.FullData(self,data,verson,nextTip)
    self.insts.upd.Text=LanguageHelper:GetText(30070,{"%%ARG1"},{verson}) 
    if nextTip then
        self.insts.nextUpd.Text=nextTip
    else
        self.insts.nextUpd.Visible=false
    end
    for k,v in pairs(data) do
        local cell=self.insts.Cell:Clone()
        cell.Parent=self.insts.Cell.Parent
        cell.Visible=true
        -- ClientOHOH:GetPath_Loop("num.TextLabel",cell).Text=k
        ClientOHOH:GetPath_Loop("TextLabel",cell).Text=v
    end
end
function M.OnShow(self,data,verson,nextTip)

end

function M.dtor(self)
	M.super.dtor(self);
end;

return M
